package com.hnkywl.sts.entity.jhgl;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.base.Sjzdz;
import com.hnkywl.sts.entity.organ.Gsjg;
import com.hnkywl.sts.entity.organ.Nbbm;
import com.hnkywl.sts.entity.sys.Gg;
import com.hnkywl.sts.entity.sys.Yg;
import com.hnkywl.sts.entity.xsgl.Zkd;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: ZHUCHG
 * Date: 13-6-24
 * Time: 下午9:04
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "T_BIZ_BGJHHZMX")
@Where(clause = "deleted!='1'")
public class Bgjhhzmx extends BaseEntity {
    //ID
    @Id
    @SequenceGenerator(name = "seqBgjhhzmx", allocationSize = 1, sequenceName = "SEQ_BIZ_BGJHHZMX")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqBgjhhzmx")
    private Long id;
    //保供计划汇总
    @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
    @JoinColumn(name = "BGJHHZ_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Bgjhhz bgjhhz;
    //规格
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "WZGG_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Gg wzgg;
    //计划数量
    private Double jhjs;
    //计划数量
    private Double jhsl;
    //库存数量
    @Transient
    private Double kcsl;
    //一级平衡数量
    private Double sl1;
    //二级平衡数量
    private Double sl2;
    //上报件数
    private Double sbjs;
    //上报数量
    private Double sbsl;
    //到货日期
    private Date dhrq;
    // 备注
    private String bz;
    // 是否后定价
    private String sfhdj;
    //退回原因
    private String thyy;
    //退回日期
    private Date thrq;
    //退回人
    private String thr;
    //状态
    //0=异常状态 1=未处理,3=供应站已处理，4=业务科已处理,5=计划已经开始提交，6=已经提交到物供, 7=计划科已处理,8=采购单已办理 10=已退回
    private Integer zt = 1;
    //计划科提交标志      已经被sfcg标志代替
    //private String jhktjbs;
    //采购方式   1是比价2是招标
    private Integer cgfs;
    // 处理人
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "GYZCLR_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Yg gyzclr;
    //业务科处理部门
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "GYZCLBM_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Gsjg gyzclbm;
    //供应站处理日期
    private Date gyzclrq;
    //业务科处理人
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "YWKCLR_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Yg ywkclr;
    //业务科处理部门
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "YWKCLBM_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Gsjg ywkclbm;
    //业务科处理日期
    private Date ywkclrq;

    //进行物资合并不做关联
//    @OneToOne(fetch = FetchType.LAZY)
//    @JoinColumn(name = "BGJHMX_ID")
//    @NotFound(action = NotFoundAction.IGNORE)
//    private Bgjhmx bgjhmx;

    //设备或者材料
    private String sbcl;

    // 业务科处理完明细，通过接口向保供发送数据，判断数据处理是否成 0：不成功，1：成
    private Integer sfcg;

    // 接口处理时间
    private Date clsj;

    //牌号
    private String ph;

    /**
     * 产地
     */
    @ManyToOne
    @JoinColumn(name = "SJZDZ_CD_ID")
    private Sjzdz cd;

    /**
     * 长宽
     */
    private String ck;

    //出错原因，由物供返回
    private String ccyy;

    @ManyToOne
    @JoinColumn(name = "SJZDZ_JZFS_ID")
    private Sjzdz jzfs;

    /**
     * 含税价
     */
    private Double hsj;

    /**
     * 不含税价
     */
    private Double bhsj;

    /**
     * 含税金额
     */
    private Double hsje;

    private String xsxt_htbm;

    private String xsxt_xsdh;

    public String getSfhdj() {
        return sfhdj;
    }

    public void setSfhdj(String sfhdj) {
        this.sfhdj = sfhdj;
    }

    public String getXsxt_htbm() {
        return xsxt_htbm;
    }

    public void setXsxt_htbm(String xsxt_htbm) {
        this.xsxt_htbm = xsxt_htbm;
    }

    public String getXsxt_xsdh() {
        return xsxt_xsdh;
    }

    public void setXsxt_xsdh(String xsxt_xsdh) {
        this.xsxt_xsdh = xsxt_xsdh;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Double getHsj() {
        return hsj;
    }

    public Double getJhjs() {
        return jhjs;
    }

    public void setJhjs(Double jhjs) {
        this.jhjs = jhjs;
    }

    public void setHsj(Double hsj) {
        this.hsj = hsj;
    }

    public Double getBhsj() {
        return bhsj;
    }

    public void setBhsj(Double bhsj) {
        this.bhsj = bhsj;
    }

    public Double getHsje() {
        return hsje;
    }

    public void setHsje(Double hsje) {
        this.hsje = hsje;
    }

    public Double getSbjs() {
        return sbjs;
    }

    public void setSbjs(Double sbjs) {
        this.sbjs = sbjs;
    }

    public String getCk() {
        return ck;
    }

    public Sjzdz getJzfs() {
        return jzfs;
    }

    public void setJzfs(Sjzdz jzfs) {
        this.jzfs = jzfs;
    }

    public void setCk(String ck) {
        this.ck = ck;
    }

    public Sjzdz getCd() {
        return cd;
    }

    public void setCd(Sjzdz cd) {
        this.cd = cd;
    }

    public Bgjhhz getBgjhhz() {
        return bgjhhz;
    }

    public void setBgjhhz(Bgjhhz bgjhhz) {
        this.bgjhhz = bgjhhz;
    }

    public Gg getWzgg() {
        return wzgg;
    }

    public void setWzgg(Gg wzgg) {
        this.wzgg = wzgg;
    }

    public Double getJhsl() {
        return jhsl;
    }

    public void setJhsl(Double jhsl) {
        this.jhsl = jhsl;
    }

    public Double getKcsl() {
        return kcsl;
    }

    public void setKcsl(Double kcsl) {
        this.kcsl = kcsl;
    }

    public Double getSl1() {
        return sl1;
    }

    public void setSl1(Double sl1) {
        this.sl1 = sl1;
    }

    public Double getSl2() {
        return sl2;
    }

    public void setSl2(Double sl2) {
        this.sl2 = sl2;
    }

    public Double getSbsl() {
        return sbsl;
    }

    public void setSbsl(Double sbsl) {
        this.sbsl = sbsl;
    }

    public Date getDhrq() {
        return dhrq;
    }

    public void setDhrq(Date dhrq) {
        this.dhrq = dhrq;
    }

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    public String getThyy() {
        return thyy;
    }

    public void setThyy(String thyy) {
        this.thyy = thyy;
    }

    public Date getThrq() {
        return thrq;
    }

    public void setThrq(Date thrq) {
        this.thrq = thrq;
    }

    public String getThr() {
        return thr;
    }

    public void setThr(String thr) {
        this.thr = thr;
    }

    public Integer getZt() {
        return zt;
    }

    public void setZt(Integer zt) {
        this.zt = zt;
    }

//    public String getJhktjbs() {
//        return jhktjbs;
//    }
//
//    public void setJhktjbs(String jhktjbs) {
//        this.jhktjbs = jhktjbs;
//    }

    public Integer getCgfs() {
        return cgfs;
    }

    public void setCgfs(Integer cgfs) {
        this.cgfs = cgfs;
    }

    public Yg getGyzclr() {
        return gyzclr;
    }

    public void setGyzclr(Yg gyzclr) {
        this.gyzclr = gyzclr;
    }

    public Date getGyzclrq() {
        return gyzclrq;
    }

    public void setGyzclrq(Date gyzclrq) {
        this.gyzclrq = gyzclrq;
    }

    public Yg getYwkclr() {
        return ywkclr;
    }

    public void setYwkclr(Yg ywkclr) {
        this.ywkclr = ywkclr;
    }

    public Date getYwkclrq() {
        return ywkclrq;
    }

    public void setYwkclrq(Date ywkclrq) {
        this.ywkclrq = ywkclrq;
    }

    public String getSbcl() {
        return sbcl;
    }

    public void setSbcl(String sbcl) {
        this.sbcl = sbcl;
    }

    public Integer getSfcg() {
        return sfcg;
    }

    public void setSfcg(Integer sfcg) {
        this.sfcg = sfcg;
    }

    public Date getClsj() {
        return clsj;
    }

    public void setClsj(Date clsj) {
        this.clsj = clsj;
    }

    public String getPh() {
        return ph;
    }

    public void setPh(String ph) {
        this.ph = ph;
    }

    public Gsjg getGyzclbm() {
        return gyzclbm;
    }

    public void setGyzclbm(Gsjg gyzclbm) {
        this.gyzclbm = gyzclbm;
    }

    public Gsjg getYwkclbm() {
        return ywkclbm;
    }

    public void setYwkclbm(Gsjg ywkclbm) {
        this.ywkclbm = ywkclbm;
    }

    public String getCcyy() {
        return ccyy;
    }

    public void setCcyy(String ccyy) {
        this.ccyy = ccyy;
    }
}
